package com.pq.dao.order;

import com.pq.pojo.order.OrderCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface OrderCartDao {
    List<OrderCart> findOrderCartByUserId(Integer userId, Integer flag, List<Long> orderCartIds);

    int updateOrderCartCountsByCartId(Integer productCounts, Integer cartId, Integer userId);

    List<OrderCart> findOrderCartByProductId(Integer userId, Integer productId);

    int updateOrderCartFlagByCartId(Long orderCartId, Integer userId);

    int updateOrderCartFlagByCartIds(Integer userId, List<Long> orderCartIds);

    @Delete("DELETE FROM order_cart WHERE order_cart_id=#{cartId}")
    int deleteByCartId(Long cartId);

}
